/*
 * File Name: ConcatProcess.java 
 * Created on: 
 */
package co.edu.uniandes.intercon.server.process;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import co.edu.uniandes.intercon.core.model.EDataType;
import co.edu.uniandes.intercon.core.model.ParamDto;

/**
 * ...
 * @author Fabian Gutierrez
 */
public class SumProcess extends AbstractBaseProcess {

	/**
	 * @see AbstractBaseProcess#execute(Map)
	 */
	@Override
	public Object execute(Map<String, Object> params) throws Exception {
		Integer value1 = Integer.parseInt((String)params.get("number1"));
		Integer value2 = Integer.parseInt((String)params.get("number2"));
		return value1 + value2;
	}
	
	/**
	 * @see AbstractBaseProcess#getName()
	 */
	public String getName() {
		return "SUMA";
	}
	
	/**
	 * @see AbstractBaseProcess#getSuggestedParams()
	 */
	@Override
	public List<ParamDto> getSuggestedParams() {
		List<ParamDto> data = new ArrayList<ParamDto>();
		ParamDto param = new ParamDto("number1", EDataType.NUMBER);
		param.setValue("1");
		data.add(param);
		param = new ParamDto("number2", EDataType.NUMBER);
		param.setValue("1");
		data.add(param);
		return data;
	}

}
